<template>
	<view>
		<view class="content">
			<view class="top1 flexs2">
				<image class="back_img" src="../../static/img/lefts.png" mode="" @click="addblack()"></image>
				<view style="font-size: 36rpx;">修改昵称</view>
				<view @tap="navJump()" >完成</view>
			</view>
			<view class="list_item">
				<input type="text" placeholder-class="input_class" v-model="nickname" value="" placeholder="请输入昵称" />
			</view>
			<view class="list_tip">4-20个字符，仅可填写数字、文字</view>
		</view>
	</view>
</template>

<script>
	import {uploadname} from '../../api/personal.js'
	export default {
		data(){
			return{
				nickname:''
			}
		},
		methods:{
			//返回上一页
			addblack() {
				uni.navigateBack()
			},
			//完成修改昵称
			navJump(){
				let token = uni.getStorageSync('token')
				uploadname(this.nickname,token).then((res)=>{
					if(res.code ==1){
						uni.navigateBack()
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.content{
	  width: 100%;
	      height: 100%;
	      overflow: hidden;
	      background-color: #f5f5f5;
	.top1 {
		background-color: #fff;
		height: 88rpx;
		width: 100%;
		padding: 0 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	
		.back_img {
			width: 20rpx;
			height: 36rpx;
		}
	}
	.list_item{
		width: 92%;
		    height: 80rpx;
		    background: #fff;
		    border-radius: 10rpx;
		    margin:20rpx auto;
		    display: flex;
		    justify-content: flex-start;
		    align-items: center;
		    padding: 0 20rpx;
		    background-color: #fff;
		/deep/.input_class{
			font-size: 28rpx;
			    font-family: PingFang SC;
			    font-weight: 500;
			    color: #999;
		}
	}
	.list_tip{
		    width: 100%;
		    padding: 0 40rpx;
		    font-size: 22rpx;
		    font-family: PingFang SC;
		    font-weight: 500;
		    color: #999;
		    margin-top: 20rpx;
		    margin-bottom: 40rpx;
	}
}
</style>
